package cz.acies.genea.data.persist;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;

public class GedEventFact implements Cloneable, Serializable
{
	private static final long serialVersionUID = -2531536858760278488L;
	
	private String id;
	private String type;
	private Timestamp date;
	private String place;
	private String descript;

	public GedEventFact() {
		this(null, null, null, null, null);
	}
	
	public GedEventFact(String id) {
		this(id, null, null, null, null);
	}

	public GedEventFact(String id, String type, Timestamp date, String place, String descript) {
		super();
		this.id = id;
		this.type = type;
		this.date = date;
		this.place = place;
		this.descript = descript;
	}

	public String getId() {
		return id;
	}

	public boolean hasId() {
		return id != null && id.trim().length() > 0;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getType() {
		return type;
	}

	public boolean hasType() {
		return type != null && type.trim().length() > 0;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Timestamp getDate() {
		return date;
	}

	public void setDate(Timestamp date) {
		this.date = date;
	}

	public boolean hasDate() {
		return date != null;
	}

	public String getPlace() {
		return place;
	}

	public boolean hasPlace() {
		return place != null && place.trim().length() > 0;
	}

	public void setPlace(String place) {
		this.place = place;
	}

	public String getDescript() {
		return descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}
	
	public boolean hasDescript() {
		return descript != null && descript.trim().length() > 0;
	}

	public Object clone() throws CloneNotSupportedException {
		Object clone = super.clone();
		assert clone instanceof GedEventFact;
		
		((GedEventFact) clone).setId(this.id);
		((GedEventFact) clone).setType(this.type);
		((GedEventFact) clone).setDate(this.date);
		((GedEventFact) clone).setPlace(this.place);
		((GedEventFact) clone).setDescript(this.descript);
		
		return clone;
	}

}
